NAME = filetrigger
MODULE = $(NAME).ko
obj-m += $(NAME).o

# Building ksocket for debug version : make DEBUG=true
ifeq ($(DEBUG),true)
	EXTRA_CFLAGS += -D_sxg_debug_
endif

MODULE_PRESENCE := $(wildcard $(MODULE))

all:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

ls:
	@@ lsmod | grep $(NAME)

msg:
	@@ dmesg | grep "FileTrigger"

default:
	@@ if test ! -e $(MODULE); then make all; fi
	insmod $(MODULE) \
	directory_number=5 \
	file_number=42 \
	update_frequency=666 \
	filesystem_location="/toto/" \
	network_location="localhost" \
	encryption_method=1

load:
	insmod $(NAME).ko

unload:
	rmmod $(NAME)

clean:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
